package com.example.commonutil.service;

import com.example.commonutil.model.Model;
import com.example.commonutil.util.YmlLoadUtil;
import org.springframework.stereotype.Service;

import java.io.IOException;

@Service
public class LoadService {
    public String loadmenu() {
        Model model;
        try {
            model = YmlLoadUtil.loadYamlFromFile("D:\\date\\code\\JAVA\\easyjava\\easy-java\\conf_test\\menu//menu.yml", Model.class);
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
        return model + "";
    }

    public String loadlocalmenu() {
        Model model;
        try {
            model = YmlLoadUtil.loadYamlFromResource("menu.yml", Model.class);
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
        return model + "";
    }
}
